//
//  AudioPlayer.h
//  Project_ZFR_MUSIC
//
//  Created by 张福润 on 16/2/26.
//  Copyright © 2016年 张福润. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>


@protocol AudioPlayerDelegate <NSObject>
//播放结束执行的协议
-(void)playFinish;

//每0.1秒执行的协议
//time  当前时间
-(void)playWithTime:(CGFloat)time;

@end

@interface AudioPlayer : NSObject
//1. 文件是单例
+(instancetype)shareAudioPlayer;
//2. 播放
-(void)playerWithUrl:(NSString *)url;
//3. 暂停/恢复
-(void)playerOrPause;
//4. 停止
-(void)stop;
//5. 从什么时候开始播放
-(void)seekToWithTime:(CGFloat)time;
//6. 设置音量

//7. 获取音量
@property (nonatomic,assign)CGFloat  volume;
//8. 是否正在播放
@property (nonatomic,assign,getter=isPlaying,readonly)BOOL playing;

@property (nonatomic,weak)id<AudioPlayerDelegate> delegate;

@end
